package com.ch.forum.service.impl;

import com.ch.forum.dao.ArtZanHistoryMapper;
import com.ch.forum.service.ArtZanHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ArtZanHistoryServiceImpl implements ArtZanHistoryService{

    @Autowired
    private ArtZanHistoryMapper artZanHistoryMapper;

    @Override
    public int add(Long artId, Long userId, int isZan) {
        return artZanHistoryMapper.add(artId, userId, 1);
    }

    @Override
    public Long findArtIsExist(Long artId, Long userId) {
        return artZanHistoryMapper.findHisIsExist(artId, userId);
    }

    @Override
    public Long findArtIsExist2(Long artId, Long userId) {
        return artZanHistoryMapper.findHisIsExist2(artId, userId);
    }

    @Override
    public int updateIsZan(Long artId, Long userId, int isZan){
        return artZanHistoryMapper.updateIsZan(isZan, artId, userId);
    }
}
